package com.scqkzqtz.basesdk;

import android.content.Context;
import android.util.Log;

import com.avos.avoscloud.AVOSCloud;
import com.zhuge.analysis.stat.ZhugeSDK;

/**
 * Created by zsx on 2018/7/27.
 */

public class initializationUtils {
    //leancloud
    private final static String leancloud_applicationId = "3G47drEAaXtmQas7U4WxEmx4-gzGzoHsz";
    private final static String leancloud_clientKey = "3G47drEAaXtmQas7U4WxEmx4-gzGzoHsz";

    public static void init(Context context) {
        initLeancloud(context);
        initZhuGeIO(context);
    }

    private static void initLeancloud(Context context) {
        AVOSCloud.setDebugLogEnabled(true);
        // 初始化应用 Id 和 应用 Key，您可以在应用设置菜单里找到这些信息
        AVOSCloud.initialize(context, leancloud_applicationId, leancloud_clientKey);
        AVOSCloud.setLogLevel(AVOSCloud.LOG_LEVEL_DEBUG);
    }

    private static void initZhuGeIO(Context context) {
        ZhugeSDK.getInstance().openLog();//在init之前调用如下接口来启动日志输出：
        ZhugeSDK.getInstance().setLogLevel(Log.INFO);//level：日志输出的级别，Log.VERBOSE,Log.DEBUG,Log.INFO,Log.WARN,Log.ERROR，默认为Log.INFO。
//        ZhugeSDK.getInstance().openDebug();//实时调试，仅在测试设备上开启。
        ZhugeSDK.getInstance().init(context, "0291ad9016fc4b7d99cc9ac62f9769dd", "yourAppChannel");//TODO 未传入yourAppChannel
    }
}
